#include"head.h"
int main(int argc,char *argv[]){
     MYSQL *conn=connect_mysql();
    int ret=create_table(conn);
    if(ret==0){
        printf("sucess\n");
    }else{
        printf("wrong\n");
    }
    DirStack dir_stack;DirStack s2;
    init_user_root_directory(conn,"king",&dir_stack);
    init_user_root_directory(conn,"whisper",&s2);
    
    char result[100];char r2[100];
    bzero(result,100);
    bzero(r2,100);
    pwd_command(conn,&dir_stack,"king",result);
    pwd_command(conn,&s2,"whsiper",r2);
    printf("pwd king :%s\n",result);
    printf("pwd whisper :%s\n",r2);
    printf("mk start\n");
   int ret1= mkdir_command(conn,&dir_stack,"dir1","king");
   if(ret1==0){
       printf("mk success\n");
   }else{
       printf("mk fail\n");
   }
   bzero(result,100);
   int ret2=cd_command(conn,&dir_stack,"dir1","king");
    pwd_command(conn,&dir_stack,"king",result);
    printf("pwd king :%s\n",result);
   int ret3=cd_command(conn,&dir_stack,"../../../","king");
   if(ret3==-1){
       printf("cd ../fail\n");

   }
   bzero(result,100);
    pwd_command(conn,&dir_stack,"king",result);
    printf("pwd king :%s\n",result);
    return 0;
}

